A. Field of the Invention
Apparatus and methods consistent with the invention relate generally to arbitration and, in particular, to apparatus and methods for providing limit-based arbitration.
B. Description of the Prior Art
Network interface cards are used to transfer data between a network and a device. The network interface card has dedicated receive circuitry and transmit circuitry for handling the transfers. If the receive circuitry and transmit circuitry compete for the same resource, then a arbiter is used to determine which circuitry gains access to the resource.
A conventional network interface card interconnects a network and a bus, such as an internal bus of a device. The network interface card includes a bus controller, which receives requests for access to the bus and grants the requests for the bus; receive circuitry, which receives information from network; transmit circuitry, which transmits data to the network; and an arbiter, which coordinates requests and grants between the bus controller, transmit circuitry, and receive circuitry.
The transmit circuitry and receive circuitry each send requests to the arbiter when they need to access the bus. The arbiter receives the requests and determines which of the transmit circuitry or receive circuitry will be granted access to the bus. In conventional systems, if no transfers are taking place at the time a request is made, and there is only one requestor, that requestor will be granted use of the bus by the arbiter. If the transmit circuitry and receive circuitry make a request substantially simultaneously, the arbiter must determine which of the transmit circuitry or receive circuitry will be granted access.
In conventional systems, the arbiter often uses a round robin arbitration scheme to resolve requests. In a round robin arbitration scheme, the grant goes to the requester that did not receive the grant in the previous round of arbitration. This system works well for many types of data transfers, but frequently creates unfairness in the system. For example, if the transmit circuitry is transferring large units of data between the bus and the network, and the receive circuitry is transferring small units of data, then the transmit circuitry will dominate use of the bus. The transmit circuitry will control the bus for a long time during a transfer, the receive circuitry will control for a short time, then the transmit circuitry will again control for a long time. Thus, the transmit circuitry will occupy the bus a disproportionate amount of time.
This may be acceptable if the receive circuitry does not have many data transfers. But if the quantity of data coming into the receive circuitry from the network is large, the receive circuitry will start dropping incoming data. Many systems suffer from this limitation because the receive circuitry in network interface cards often has limited receive buffer capacity. Thus, conventional systems do not provide optimum fairness among requestors in many situations.
The round robin arbitration scheme also treats both requestors equally at the time of arbitration. Due to limited on-chip receive buffer capacity and relatively unlimited transmit capacity in host memory, it is desirable to weight receive traffic greater then transmit traffic. Preemption has been used in the past to preempt transmit traffic and make way for receiving traffic. Preemption, however, opens up the possibility for unlimited starvation of transmit traffic if receive is active. What is needed, then, is a method and system that provides fairness in a manner that cures the above problems.